#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	FILE* fp=NULL;
	char ch = 0;
	char filename[20] = { 0 };
	scanf("%s", filename);
	if ((fp=fopen(filename, "w")) == NULL)
	{
		printf("cannot open the file");
		exit(0);
	}
	getchar();
	ch = getchar();
	while (ch!='#')
	{
		fputc(ch,fp);
		ch=getchar();
	}
	fclose(fp);
	return 0;
}